﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PlugNT.Cms.Core;
using PlugNT.Cms.BLL;
using PlugNT.Cms.Model;
using PlugNT.Cms.Page;

namespace PlugNT.Cms.Web.Admin.Pre_GroupAdmin
{
    public partial class Admin : AdminPage
    {
        private GroupAdmin curGroupAdmin = new GroupAdmin();
        private int pageSize = 15;
        protected void Page_Load(object sender, EventArgs e)
        {
            //权限检测
            this.CheckPower();

            if (!IsPostBack)
            {
                try
                {
                    Repeater_admin_bind();
                }
                catch (Exception ex) { Response.Redirect("../Message.aspx?message=绑定异常！" + ex.Message + "&z=no"); }
            }
        }


        #region 数据绑定
        void Repeater_admin_bind()
        {
            string t = (Request.QueryString["t"] == null) ? "" : Request.QueryString["t"].Trim();
            string id = (Request.QueryString["id"] == null) ? "0" : Request.QueryString["id"].Trim();
            if (t == "delete")
            {
                curGroupAdmin.Delete(int.Parse(id));
            }
            DataTable dt = curGroupAdmin.GetList();

            Repeater_admin.DataSource = dt;
            Repeater_admin.DataBind();
        }
        #endregion


        
    }
}
